#include<bits/stdc++.h>
#include<string.h>
#include<string>
#include<iostream>
using namespace std;
int main()
{
	string f,g;
	char k;
	int n;
	int a[40000]={0};
	int i,j,p=1;
	int b;
	cin>>f;
	n=f.length();
	k=f[0];
	if(k=='0') b=0;
	else b=1;
	a[1]=1;
	for(j=1;j<n;j++)
	{
		if(f[j]==k) a[p]++;
		else a[++p]++;
		k=f[j];
	};
	for(i=2;i<=n;i++)
	{
		cin>>g;
		for(j=0;j<n;j++)
		{
			if(g[j]==k) a[p]++;
			else a[++p]++;
			k=g[j];
		};
	};
	cout<<n<<" ";
	if(b==1) cout<<0<<" ";
	for(i=1;a[i]!=0;i++)
	cout<<a[i]<<" ";
	return 0;
}
